/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = exports = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1616402674567_7898';

  // add your middleware config here
  // config.middleware = ['cors',"auth"];

  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
  };
  
  config.security = {
    csrf:{
      enable:false
    }
  };

  config.mongoose = {
    clients:{
      db1:{
        url:'mongodb://test:123@47.119.132.191:27017/wechatmovie?authSource=admin',
        // url:'mongodb://test:123@47.108.197.128:27017/movies?authSource=admin',
        options:{
          useNewUrlParser:true
        }
      },
      db2:{
        url:'mongodb://test:123@120.25.251.98:27017/wechat?authSource=admin',
        options:{
          useNewUrlParser:true
        }
      },
    },
  };

  config.arttemplate = {
    escape:true,
    debug:false,
    bail:true,
    cache:true
  };

  

  config.jwt = {
    secret:"123456"
  };
  config.view = {
    mapping: {
      '.html': 'arttemplate',
    },
  };
  return {
    ...config,
    ...userConfig,
  };
};
